home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / program / tsetguid.zip / TEA / SET / SAMPLE / GRIDDUO.JAV < prev    next >
Text File  |  1997-02-27  |  2KB  |  62 lines

  1. /*
  2.  * Copyright (c) 1996-1997, InetSoft Technology Corp, All Rights Reserved.
  3.  *
  4.  * The software and information contained herein are copyrighted and 
  5.  * proprietary to InetSoft Technology Corp. This software is furnished 
  6.  * pursuant to a written license agreement and may be used, copied, 
  7.  * transmitted, and stored only in accordance with the terms of such 
  8.  * license and with the inclusion of the above copyright notice. Please 
  9.  * refer to the file "COPYRIGHT" for further copyright and licensing 
  10.  * information. This software and information or any other copies 
  11.  * thereof may not be provided or otherwise made available to any 
  12.  * other person. 
  13.  */
  14. package tea.set.sample;
  15.  
  16. import java.applet.*;
  17. import java.awt.*;
  18. import tea.set.*;
  19.  
  20. /**
  21.  * This is a demo applet to show using tea.set.TextGrid.
  22.  *
  23.  * @see Grid
  24.  * @see TextGrid
  25.  * @version 1.3, 01/31/97
  26.  * @author InetSoft Technology Corp
  27.  */
  28. public class GridDuo extends Applet {
  29.    public void init() {
  30.       setLayout(new BorderLayout(0, 15));
  31.       
  32.       add("North", form);
  33.       add("South", new Effect3D(list, Effect3D.RAISED_BORDER));
  34.       
  35.       form.setRuling(Grid.NONE);
  36.       form.setAlignment(Grid.ALL_CELL, 0, Grid.H_RIGHT);
  37.       form.setForeground(Grid.ALL_CELL, 1, Color.white);
  38.       form.setBackground(Grid.ALL_CELL, 1, Color.gray);
  39.       form.setAlignment(Grid.ALL_CELL, 1, Grid.H_LEFT);
  40.       form.setAlignment(Grid.ALL_CELL, 2, Grid.H_RIGHT);
  41.       form.setForeground(Grid.ALL_CELL, 3, Color.white);
  42.       form.setBackground(Grid.ALL_CELL, 3, Color.gray);
  43.       form.setGap(Grid.ALL_CELL, Grid.ALL_CELL, new Insets(1,2,1,2));
  44.       for(int i = 0; i < layout.length; i++) {
  45.      form.setRow(i, Tool.tokenize(layout[i], ";"));
  46.       }
  47.  
  48.       list.setEditable(true);
  49.       list.setCharSize(Grid.ALL_CELL, 0, new Dimension(15, 1));
  50.       list.setCharSize(Grid.ALL_CELL, 1, new Dimension(20, 1));
  51.       list.setCharSize(Grid.ALL_CELL, 2, new Dimension(40, 1));
  52.       list.setColHeader(Tool.tokenize("Skill;Level;Description", ";"));
  53.    }
  54.    
  55.    private String[] layout = {"First Name;<EDIT:1,15>;Last Name;<EDIT:1,15>",
  56.                   "SS#;<MASK>[999]-[99]-[9999]",
  57.                   " ;<BUTTON>Retrieve;<BUTTON>Save;"
  58.    };
  59.    private TextGrid form = new TextGrid(3, 4);
  60.    private TextGrid list = new TextGrid(5, 3);
  61. }
  62.